package com.neu.wms.util;

/**
 * @description 服务状态码
 * @author DAIJUNQIANG
 * @date 2023/7/4 9:08
 * @version 1.0
 */
public enum ServerCode {

    //自定义的状态码
    ERR_BAD_REQUEST(400, "请求参数格式错误"),
    ERR_UNAUTHORIZED(401, "未授权登录"),
    ERR_FORBIDDEN(403, "无权限访问"),
    ERR_NOT_FOUND(404, "相关资源或数据不存在"),
    ERR_CONFLICT(409, "数据冲突"),
    ERR_INSERT(5001, "插入数据时的错误"),
    ERR_DELETE(5002, "删除数据时的错误"),
    ERR_UPDATE(5003, "修改数据时的错误"),
    ERR_INTERNAL_SERVER_ERROR(500, "服务器内部错误"),
    ERR_JWT_PARSE(6000, "解析jwt失败：格式错误，或签名错误"),
    ERR_JWT_EXPIRED(6001, "解析jwt失败：过期"),
    MONITOR_EXCEPTION(304, "文件监控异常");
    //错误码
    public Integer code;
    //提示信息
    public String message;

    //构造函数
    ServerCode(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    //获取状态码
    public Integer getCode() {
        return code;
    }

    //获取提示信息
    public String getMessage() {
        return message;
    }

}
